package com.tjetc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.DispatcherServlet;

/**
 * 演示转发和重定向
 *
 *
 * @author gaoyongxiang
 * @version v1.0
 * @date 2025/9/5
 */
@Controller
@RequestMapping("/path/")
public class _5RequestForwardAndRedirect {


    // 演示转发
    @RequestMapping("forward")
    public String f(){
        // 默认就是转发
//        return "ok";
        return "forward:/view/ok.jsp";
    }


    @RequestMapping("redirect")
    public String f1(){
        // 默认就是转发
//        return "ok";
        return "redirect:/view/ok.jsp";
    }

}